#ifndef _DB_INDEX_H_
#define _DB_INDEX_H_

typedef struct tagIndex{
	char name[MAXPATH];
	int used;
	int reserved;
	int total;
	int offset;
}INDEX;

int build_index(void);

int add_type_recid(int type, int recid);
int add_like_recid(int like, int recid);
int add_folder_recid(char* folder, int recid);
int add_pl_recid(char* artist, int recid);
int add_album_recid(char* album, int recid);
int add_artist_recid(char* artist, int recid);

int del_type_recid(int type, int recid);
int del_like_recid(int like, int recid);
int del_folder_recid(char* folder, int recid);
int del_pl_recid(char* artist, int recid);
int del_album_recid(char* album, int recid);
int del_artist_recid(char* artist, int recid);

int get_type_recid(int type, int offset, int * recid, int * cnt);
int get_like_recid(int like, int offset, int * recid, int * cnt);
int get_folder_recid(char* folder, int offset, int * recid, int * cnt);
int get_pl_recid(char* artist, int offset, int * recid, int * cnt);
int get_album_recid(char* album, int offset, int * recid, int * cnt);
int get_artist_recid(char* artist, int offset, int * recid, int * cnt);

int get_type_index(int type, INDEX * idx);
int get_like_index(int like, INDEX * idx);
int get_folder_index(char* folder, INDEX * idx);
int get_pl_index(char* artist, INDEX * idx);
int get_album_index(char* album, INDEX * idx);
int get_artist_index(char* artist, INDEX * idx);

#endif
